/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import Controllers.Factory;
import Controllers.IUsers;

/**
 *
 * @author ayle
 */
public class UsersPanel extends javax.swing.JPanel {
    
    Factory factory = Factory.getFactory();
    IUsers iUsers = factory.getIUsers();

    /**
     * Creates new form UsersPanel
     */
    public UsersPanel() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        ListContainer = new javax.swing.JPanel();
        ScrollList = new javax.swing.JScrollPane();
        List = new javax.swing.JList();
        TitleContainer = new javax.swing.JPanel();
        title = new javax.swing.JTextField();
        ButtonsContainer = new javax.swing.JPanel();
        EditButton = new javax.swing.JButton();
        BackButton = new javax.swing.JButton();
        ShowUserPanel = new javax.swing.JPanel();

        setMaximumSize(new java.awt.Dimension(400, 281));
        setMinimumSize(new java.awt.Dimension(400, 281));
        setOpaque(false);
        setPreferredSize(new java.awt.Dimension(400, 281));

        ListContainer.setMaximumSize(new java.awt.Dimension(167, 222));
        ListContainer.setMinimumSize(new java.awt.Dimension(167, 222));
        ListContainer.setOpaque(false);
        ListContainer.setLayout(new java.awt.BorderLayout());

        ScrollList.setMaximumSize(new java.awt.Dimension(167, 222));
        ScrollList.setMinimumSize(new java.awt.Dimension(167, 222));
        ScrollList.setOpaque(false);
        ScrollList.setPreferredSize(new java.awt.Dimension(167, 222));

        List.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        ScrollList.setViewportView(List);

        ListContainer.add(ScrollList, java.awt.BorderLayout.CENTER);

        TitleContainer.setMaximumSize(new java.awt.Dimension(155, 20));
        TitleContainer.setMinimumSize(new java.awt.Dimension(155, 20));
        TitleContainer.setOpaque(false);
        TitleContainer.setPreferredSize(new java.awt.Dimension(155, 20));
        TitleContainer.setLayout(new java.awt.BorderLayout());

        title.setEditable(false);
        title.setBackground(new java.awt.Color(254, 254, 254));
        title.setFont(new java.awt.Font("Ubuntu", 1, 12)); // NOI18N
        title.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        title.setText("USERS LIST");
        title.setFocusable(false);
        TitleContainer.add(title, java.awt.BorderLayout.CENTER);

        ListContainer.add(TitleContainer, java.awt.BorderLayout.PAGE_START);

        ButtonsContainer.setMaximumSize(new java.awt.Dimension(207, 50));
        ButtonsContainer.setMinimumSize(new java.awt.Dimension(207, 50));
        ButtonsContainer.setOpaque(false);

        EditButton.setText("Edit");

        BackButton.setText("Back");
        BackButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BackButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout ButtonsContainerLayout = new javax.swing.GroupLayout(ButtonsContainer);
        ButtonsContainer.setLayout(ButtonsContainerLayout);
        ButtonsContainerLayout.setHorizontalGroup(
            ButtonsContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ButtonsContainerLayout.createSequentialGroup()
                .addGap(55, 55, 55)
                .addComponent(EditButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(BackButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(83, 83, 83))
        );
        ButtonsContainerLayout.setVerticalGroup(
            ButtonsContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ButtonsContainerLayout.createSequentialGroup()
                .addGroup(ButtonsContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EditButton)
                    .addComponent(BackButton))
                .addGap(0, 24, Short.MAX_VALUE))
        );

        ShowUserPanel.setMaximumSize(new java.awt.Dimension(195, 230));
        ShowUserPanel.setMinimumSize(new java.awt.Dimension(195, 230));
        ShowUserPanel.setOpaque(false);
        ShowUserPanel.setPreferredSize(new java.awt.Dimension(195, 230));

        javax.swing.GroupLayout ShowUserPanelLayout = new javax.swing.GroupLayout(ShowUserPanel);
        ShowUserPanel.setLayout(ShowUserPanelLayout);
        ShowUserPanelLayout.setHorizontalGroup(
            ShowUserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 262, Short.MAX_VALUE)
        );
        ShowUserPanelLayout.setVerticalGroup(
            ShowUserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(ListContainer, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(ShowUserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20))
            .addComponent(ButtonsContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(ListContainer, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ShowUserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ButtonsContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(6, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void BackButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BackButtonActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_BackButtonActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BackButton;
    private javax.swing.JPanel ButtonsContainer;
    private javax.swing.JButton EditButton;
    private javax.swing.JList List;
    private javax.swing.JPanel ListContainer;
    private javax.swing.JScrollPane ScrollList;
    private javax.swing.JPanel ShowUserPanel;
    private javax.swing.JPanel TitleContainer;
    private javax.swing.JTextField title;
    // End of variables declaration//GEN-END:variables
}
